package com.vip8.recorder.service.utils;

public class MobileValidator {

    // 正则表达式规则：
    // 1. 11位数字
    // 2. 以数字"1"开头
    // 3. 第二位是[3456789]
    private static final String PHONE_REGEX = "^1[3456789]\\d{9}$";

    public static boolean isValidChineseMobileNumber(String number) {
        if (number == null || number.isEmpty()) {
            return false;
        }
        return number.matches(PHONE_REGEX);
    }

    public static void main(String[] args) {
        String mobileNumber = "138123456781";
        boolean isValid = isValidChineseMobileNumber(mobileNumber);
        System.out.println("Is valid mobile number: " + isValid);
    }
}